import Vue from 'vue'
import Router from 'vue-router'

import Admin from '@/components/index'
import Login from '@/components/login'//登录页面
import Send from '@/components/send' //发送短信
import Audit from '@/components/audit' //审核短信
import History from '@/components/history' //发送短信历史列表
import Purchase from '@/components/purchase'; //在线充值
import Orderfrom from '@/components/order-from'; //订单列表
import Wxpay from '@/components/wxpay'; //微信支付
import OrderList from '@/components/order-list'; // 支付列表
import Verify from '@/components/verify'; //实名认证
import Agents from '@/components/agent';
import NotFound from '@/components/404'

import Index from '@/components/view/index' //前端首页
import Callshow from '@/components/view/callshow' //来电秀
import Letter from '@/components/view/letter' //闪信
import Lostrepair from '@/components/view/lostrepair' //失联修复
import Precision from '@/components/view/precision' //精准营销
import Agent from '@/components/view/agent' //加盟代理


import Axios from 'axios'
Axios.defaults.baseURL = 'http://sxapi.jin315.com/'
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.prototype.$ajax = Axios

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: {
        name: 'index'
      }
    },
    {
      name:'index',
      path:'/index',
      component:Index,
      meta: {
        title: '首页'
      }
    },
    {
      name:'admin',
      path:'/admin',
      component:Admin,
      meta: {
        title: '账户概览'
      }
    },
    {
      name:'callshow',
      path:'/callshow',
      component:Callshow,
      meta: {
        title: '来电秀'
      }
    },
    {
      name:'letter',
      path:'/letter',
      component:Letter,
      meta: {
        title: '闪信'
      }
    },
    {
      name:'lostrepair',
      path:'/lostrepair',
      component:Lostrepair,
      meta: {
        title: '失联修复'
      }
    },
    {
      name:'precision',
      path:'/precision',
      component:Precision,
      meta: {
        title: '精准营销'
      }
    },
    {
      name:'agent',
      path:'/agent',
      component:Agent,
      meta: {
        title: '加盟代理'
      }
    },
    {
      name:'login',
      path:'/login',
      component:Login,
      meta: {
        title: '注册/登录'
      }
    },
    {
      name:'send',
      path:'/send',
      component:Send,
      meta: {
        title: '发送闪信'
      }
    },
    {
      name:'order-list',
      path:'/order-list',
      component:OrderList,
      meta: {
        title: '订单列表'
      }
    },
    {
      name:'audit',
      path:'/audit',
      component:Audit,
      meta: {
        title: '审核闪信'
      }
    },
    {
      name:'purchase',
      path:'/purchase',
      component:Purchase,
      meta: {
        title: '在线购买'
      }
    },
    {
      name:'orderfrom',
      path:'/order-from',
      component:Orderfrom,
      meta: {
        title: '订单列表'
      }
    },
    {
      name:'verify',
      path:'/verify',
      component:Verify,
      meta: {
        title: '实名认证'
      }
    },
    {
      name:'agents',
      path:'/agents',
      component:Agents,
      meta: {
        title: '加盟代理'
      }
    },
    {
      name:'wxpay',
      path:'/wxpay',
      component:Wxpay,
      meta: {
        title: '微信支付'
      }
    },
    {
      name:'history',
      path:'/history',
      component:History,
      meta: {
        title: '发送历史'
      }
    },
    {
      path:'*',
      name:'404',
      component:NotFound,
      meta: {
        title: '未找到-404'
      }
    }
    
  ]
})
